package cn.schina.dbfw.dao.impl;

import java.util.ArrayList;
import java.util.Iterator;

public class DBWithDbfw {
	int id;
	String name_forprotected;	//被保护的数据库名称（描述性名称）
	String dbtype;	//数据库类型
	String dbversion;	//数据库版本
	int dialect;		//DB方言	
	String name;	//被保护的数据库实例名称,对应db_service_name
	String db_address;	//DB的IP地址
	int db_port;		//DB的服务端口
	
	ArrayList<Dbfw> dbfwArray = new ArrayList<Dbfw>();
	public void setDbfwArray(ArrayList<Dbfw> dbfwArray) {
		this.dbfwArray = dbfwArray;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDbtype() {
		return dbtype;
	}
	public void setDbtype(String dbtype) {
		this.dbtype = dbtype;
	}
	public String getDbversion() {
		return dbversion;
	}
	public void setDbversion(String dbversion) {
		this.dbversion = dbversion;
	}
	public int getDialect() {
		return dialect;
	}
	public void setDialect(int dialect) {
		this.dialect = dialect;
	}
	
	public void addDbfwForDB(Dbfw dbfw)
	{
		Iterator<Dbfw> it = dbfwArray.iterator();
		while(it.hasNext())
		{
			Dbfw tmp_dbfw = it.next();
			if(tmp_dbfw.getInstid()==dbfw.getInstid())
			{
				//该DBFW实例已经加入了
				return;
			}
		}
		dbfwArray.add(dbfw);
	}
	public ArrayList<Dbfw> getDbfwArray() {
		return dbfwArray;
	}
	public String getName_forprotected() {
		return name_forprotected;
	}
	public void setName_forprotected(String name_forprotected) {
		this.name_forprotected = name_forprotected;
	}
	public String getDb_address() {
		return db_address;
	}
	public void setDb_address(String db_address) {
		this.db_address = db_address;
	}
	public int getDb_port() {
		return db_port;
	}
	public void setDb_port(int db_port) {
		this.db_port = db_port;
	}
}
